home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / sockdem.zip / _SETUP.1 / sockets.cpp < prev    next >
C/C++ Source or Header  |  1997-06-17  |  2KB  |  81 lines

  1. // sockets.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "sockets.h"
  6. #include "socketsDlg.h"
  7.  
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CSocketsApp
  16.  
  17. BEGIN_MESSAGE_MAP(CSocketsApp, CWinApp)
  18.     //{{AFX_MSG_MAP(CSocketsApp)
  19.         // NOTE - the ClassWizard will add and remove mapping macros here.
  20.         //    DO NOT EDIT what you see in these blocks of generated code!
  21.     //}}AFX_MSG
  22.     ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  23. END_MESSAGE_MAP()
  24.  
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CSocketsApp construction
  27.  
  28. CSocketsApp::CSocketsApp()
  29. {
  30.     // TODO: add construction code here,
  31.     // Place all significant initialization in InitInstance
  32. }
  33.  
  34. /////////////////////////////////////////////////////////////////////////////
  35. // The one and only CSocketsApp object
  36.  
  37. CSocketsApp theApp;
  38.  
  39. /////////////////////////////////////////////////////////////////////////////
  40. // CSocketsApp initialization
  41.  
  42. BOOL CSocketsApp::InitInstance()
  43. {
  44.     if (!AfxSocketInit())
  45.     {
  46.         AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
  47.         return FALSE;
  48.     }
  49.  
  50.     AfxEnableControlContainer();
  51.  
  52.     // Standard initialization
  53.     // If you are not using these features and wish to reduce the size
  54.     //  of your final executable, you should remove from the following
  55.     //  the specific initialization routines you do not need.
  56.  
  57. #ifdef _AFXDLL
  58.     Enable3dControls();            // Call this when using MFC in a shared DLL
  59. #else
  60.     Enable3dControlsStatic();    // Call this when linking to MFC statically
  61. #endif
  62.  
  63.     CSocketsDlg dlg;
  64.     m_pMainWnd = &dlg;
  65.     int nResponse = dlg.DoModal();
  66.     if (nResponse == IDOK)
  67.     {
  68.         // TODO: Place code here to handle when the dialog is
  69.         //  dismissed with OK
  70.     }
  71.     else if (nResponse == IDCANCEL)
  72.     {
  73.         // TODO: Place code here to handle when the dialog is
  74.         //  dismissed with Cancel
  75.     }
  76.  
  77.     // Since the dialog has been closed, return FALSE so that we exit the
  78.     //  application, rather than start the application's message pump.
  79.     return FALSE;
  80. }
  81.